package com.example.lockscreenanimation.object;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;

import com.example.lockscreenanimation.utils.Contants;

public class Texture {

	private Context mContext;
	private Bitmap texture;
	private int width;
	private int height;

	public Texture(Context context, int resouce) {
		mContext = context;
		texture = Contants.loadBitmap(mContext, resouce);
		width = texture.getWidth();
		height = texture.getHeight();
	}

	public void onDraw(Canvas canvas, int x, int y) {

		Rect src = new Rect(0, 0, width, height);
		Rect dst = new Rect(x, y, x + width, y + height);

		canvas.drawBitmap(getTexture(), src, dst, null);

	}
	
	
//	public boolean isCollition(float x2, float y2) {
//
//		return x2 > x && x2 < x + width && y2 > y && y2 < y + height;
//
//	}

	public Bitmap getTexture() {
		return texture;
	}

	public void setTexture(Bitmap texture) {
		this.texture = texture;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

}
